package com.nondo.dean.order.mapper;

import com.nondo.dean.common.mybatis.Table;
import com.nondo.dean.order.domain.OrderSubject;
import com.nondo.dean.order.domain.OrderSubjectExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

@Table("order_subject")
@Mapper
public interface OrderSubjectMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_subject
     *
     * @mbg.generated Thu May 31 17:31:51 CST 2018
     */
    @SelectProvider(type=OrderSubjectSqlProvider.class, method="countByExample")
    long countByExample(OrderSubjectExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_subject
     *
     * @mbg.generated Thu May 31 17:31:51 CST 2018
     */
    @DeleteProvider(type=OrderSubjectSqlProvider.class, method="deleteByExample")
    int deleteByExample(OrderSubjectExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_subject
     *
     * @mbg.generated Thu May 31 17:31:51 CST 2018
     */
    @Delete({
        "delete from order_subject",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_subject
     *
     * @mbg.generated Thu May 31 17:31:51 CST 2018
     */
    @Insert({
        "insert into order_subject (order_code, user_id, ",
        "user_no, user_name, ",
        "user_telphone, user_address, ",
        "user_region_code, order_take_user, ",
        "sap_code, amount, ",
        "note, sale_guide, ",
        "user_type, delivery_user, ",
        "contract, business_code, ",
        "order_status, platform, ",
        "audit_status, payment, ",
        "online_pay, special_amount, ",
        "create_by, create_date, ",
        "update_by, update_date, ",
        "remarks, del_flag)",
        "values (#{orderCode,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}, ",
        "#{userNo,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, ",
        "#{userTelphone,jdbcType=VARCHAR}, #{userAddress,jdbcType=VARCHAR}, ",
        "#{userRegionCode,jdbcType=VARCHAR}, #{orderTakeUser,jdbcType=VARCHAR}, ",
        "#{sapCode,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, ",
        "#{note,jdbcType=VARCHAR}, #{saleGuide,jdbcType=VARCHAR}, ",
        "#{userType,jdbcType=VARCHAR}, #{deliveryUser,jdbcType=VARCHAR}, ",
        "#{contract,jdbcType=VARCHAR}, #{businessCode,jdbcType=VARCHAR}, ",
        "#{orderStatus,jdbcType=INTEGER}, #{platform,jdbcType=INTEGER}, ",
        "#{auditStatus,jdbcType=INTEGER}, #{payment,jdbcType=INTEGER}, ",
        "#{onlinePay,jdbcType=INTEGER}, #{specialAmount,jdbcType=DECIMAL}, ",
        "#{createBy,jdbcType=BIGINT}, #{createDate,jdbcType=TIMESTAMP}, ",
        "#{updateBy,jdbcType=BIGINT}, #{updateDate,jdbcType=TIMESTAMP}, ",
        "#{remarks,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(OrderSubject record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_subject
     *
     * @mbg.generated Thu May 31 17:31:51 CST 2018
     */
    @InsertProvider(type=OrderSubjectSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insertSelective(OrderSubject record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_subject
     *
     * @mbg.generated Thu May 31 17:31:51 CST 2018
     */
    @SelectProvider(type=OrderSubjectSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="order_code", property="orderCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="user_no", property="userNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_telphone", property="userTelphone", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_address", property="userAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_region_code", property="userRegionCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_take_user", property="orderTakeUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="sap_code", property="sapCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL),
        @Result(column="note", property="note", jdbcType=JdbcType.VARCHAR),
        @Result(column="sale_guide", property="saleGuide", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
        @Result(column="delivery_user", property="deliveryUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="contract", property="contract", jdbcType=JdbcType.VARCHAR),
        @Result(column="business_code", property="businessCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_status", property="orderStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="platform", property="platform", jdbcType=JdbcType.INTEGER),
        @Result(column="audit_status", property="auditStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="payment", property="payment", jdbcType=JdbcType.INTEGER),
        @Result(column="online_pay", property="onlinePay", jdbcType=JdbcType.INTEGER),
        @Result(column="special_amount", property="specialAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<OrderSubject> selectByExampleWithRowbounds(OrderSubjectExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_subject
     *
     * @mbg.generated Thu May 31 17:31:51 CST 2018
     */
    @SelectProvider(type=OrderSubjectSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="order_code", property="orderCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="user_no", property="userNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_telphone", property="userTelphone", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_address", property="userAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_region_code", property="userRegionCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_take_user", property="orderTakeUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="sap_code", property="sapCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL),
        @Result(column="note", property="note", jdbcType=JdbcType.VARCHAR),
        @Result(column="sale_guide", property="saleGuide", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
        @Result(column="delivery_user", property="deliveryUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="contract", property="contract", jdbcType=JdbcType.VARCHAR),
        @Result(column="business_code", property="businessCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_status", property="orderStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="platform", property="platform", jdbcType=JdbcType.INTEGER),
        @Result(column="audit_status", property="auditStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="payment", property="payment", jdbcType=JdbcType.INTEGER),
        @Result(column="online_pay", property="onlinePay", jdbcType=JdbcType.INTEGER),
        @Result(column="special_amount", property="specialAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<OrderSubject> selectByExample(OrderSubjectExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_subject
     *
     * @mbg.generated Thu May 31 17:31:51 CST 2018
     */
    @Select({
        "select",
        "id, order_code, user_id, user_no, user_name, user_telphone, user_address, user_region_code, ",
        "order_take_user, sap_code, amount, note, sale_guide, user_type, delivery_user, ",
        "contract, business_code, order_status, platform, audit_status, payment, online_pay, ",
        "special_amount, create_by, create_date, update_by, update_date, remarks, del_flag",
        "from order_subject",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="order_code", property="orderCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="user_no", property="userNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_telphone", property="userTelphone", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_address", property="userAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_region_code", property="userRegionCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_take_user", property="orderTakeUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="sap_code", property="sapCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL),
        @Result(column="note", property="note", jdbcType=JdbcType.VARCHAR),
        @Result(column="sale_guide", property="saleGuide", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
        @Result(column="delivery_user", property="deliveryUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="contract", property="contract", jdbcType=JdbcType.VARCHAR),
        @Result(column="business_code", property="businessCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_status", property="orderStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="platform", property="platform", jdbcType=JdbcType.INTEGER),
        @Result(column="audit_status", property="auditStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="payment", property="payment", jdbcType=JdbcType.INTEGER),
        @Result(column="online_pay", property="onlinePay", jdbcType=JdbcType.INTEGER),
        @Result(column="special_amount", property="specialAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    OrderSubject selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_subject
     *
     * @mbg.generated Thu May 31 17:31:51 CST 2018
     */
    @UpdateProvider(type=OrderSubjectSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") OrderSubject record, @Param("example") OrderSubjectExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_subject
     *
     * @mbg.generated Thu May 31 17:31:51 CST 2018
     */
    @UpdateProvider(type=OrderSubjectSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") OrderSubject record, @Param("example") OrderSubjectExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_subject
     *
     * @mbg.generated Thu May 31 17:31:51 CST 2018
     */
    @UpdateProvider(type=OrderSubjectSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(OrderSubject record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_subject
     *
     * @mbg.generated Thu May 31 17:31:51 CST 2018
     */
    @Update({
        "update order_subject",
        "set order_code = #{orderCode,jdbcType=VARCHAR},",
          "user_id = #{userId,jdbcType=INTEGER},",
          "user_no = #{userNo,jdbcType=VARCHAR},",
          "user_name = #{userName,jdbcType=VARCHAR},",
          "user_telphone = #{userTelphone,jdbcType=VARCHAR},",
          "user_address = #{userAddress,jdbcType=VARCHAR},",
          "user_region_code = #{userRegionCode,jdbcType=VARCHAR},",
          "order_take_user = #{orderTakeUser,jdbcType=VARCHAR},",
          "sap_code = #{sapCode,jdbcType=VARCHAR},",
          "amount = #{amount,jdbcType=DECIMAL},",
          "note = #{note,jdbcType=VARCHAR},",
          "sale_guide = #{saleGuide,jdbcType=VARCHAR},",
          "user_type = #{userType,jdbcType=VARCHAR},",
          "delivery_user = #{deliveryUser,jdbcType=VARCHAR},",
          "contract = #{contract,jdbcType=VARCHAR},",
          "business_code = #{businessCode,jdbcType=VARCHAR},",
          "order_status = #{orderStatus,jdbcType=INTEGER},",
          "platform = #{platform,jdbcType=INTEGER},",
          "audit_status = #{auditStatus,jdbcType=INTEGER},",
          "payment = #{payment,jdbcType=INTEGER},",
          "online_pay = #{onlinePay,jdbcType=INTEGER},",
          "special_amount = #{specialAmount,jdbcType=DECIMAL},",
          "create_by = #{createBy,jdbcType=BIGINT},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_by = #{updateBy,jdbcType=BIGINT},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "del_flag = #{delFlag,jdbcType=CHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(OrderSubject record);
}